@extends('Admin/index/index')
@section('content')
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">商品列表</h1>
  @if(session('error'))
            <div class="alert alert-danger">
            {{session('error')}}
            </div>
        @endif
        @if(session('success'))
            <div class="alert alert-info">
            {{session('success')}}
            </div>
        @endif
  <div class="panel panel-default">
    <div class="panel-heading">
        商品列表
    </div>
    <!-- /.panel-heading -->
    <div class="panel-body">
        <div class="dataTable_wrapper">
            <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
            <div class="row">
            <form action="{{url('/admin/goods/index')}}" method="get">
            <div class="col-sm-6">
            <div class="dataTables_length" id="dataTables-example_length">
            <label>显示 
            <select name="num" aria-controls="dataTables-example" class="form-control input-sm">
            <option value="10" @if(!empty($request['num']) && $request['num'] == 10) { selected } @endif>10</option>
            <option value="25" @if(!empty($request['num']) && $request['num'] == 25) { selected } @endif>25</option>
            <option value="50" @if(!empty($request['num']) && $request['num'] == 50) { selected } @endif>50</option>
            <option value="100" @if(!empty($request['num']) && $request['num'] == 100) { selected } @endif>100</option>
            </select> 条/页</label>
            </div>
            </div>
            <div class="col-sm-6">
            <div id="dataTables-example_filter" class="dataTables_filter">
            <label>商品名:<input name="keywords" value="@if(!empty($request['keywords'])){{$request['keywords']}}@endif" type="search" class="form-control input-sm" placeholder="" aria-controls="dataTables-example">
            </label>
            <button class="btn btn-primary">搜索</button>
            </div>
            </div>
            </form>

            </div>
            <div class="row"><div class="col-sm-12"><table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example" role="grid" aria-describedby="dataTables-example_info">
                <thead>
                    <tr role="row">
                    <th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">ID号</th>
                    <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">商品标题</th>
                    <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">图片</th>
                    <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" >价钱</th>
                    <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">url地址</th>
                    <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">板块id</th>
                    <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($goods as $k=>$v)
                    <tr class="gradeA odd" role="row">
                        <td class="sorting_1">{{$v->id}}</td>
                        <td>{{$v->title}}</td>
                        <td><img src="/goods/{{$v->pic}}" alt="商品图片加载失败" style="width: 50px;height: 50px;"></td>
                        <td class="center">{{$v->price}}</td>
                        <td class="center">{{$v->url}}</td>
                        <td class="center">{{$v->cid}}</td>
                        <td class="center"><a href="{{url('admin/goods/delete',['id'=>$v->id])}}" class="fa fa-trash-o">删除</a>&nbsp;|&nbsp;
                        <a href="{{url('admin/goods/edit',['id'=>$v->id])}}" class="fa fa-wrench">修改</a></td>
                    </tr>
                    @endforeach
                    </tbody>
            </table>
            </div>
            </div>
            <div class="row">
            <div class="col-sm-6">
            <div class="dataTables_info" id="dataTables-example_info" role="status" aria-live="polite">Showing 1 to 10 of 57 entries</div>
            </div>
            <div class="col-sm-6">
            <div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate">
           
           
            </div></div></div>
            </div>
        </div>
  
    </div>
    <!-- /.panel-body -->
</div>
</div>
</div>
</div>
@endsection